import unittest

import requests

from common.get_headers_util import get_headers_util


class THRMEmpCRUD():
    #员工增加接口
    @classmethod
    def ihrm_emp_insert(self,json_data):
        resp = requests.post(url="http://ihrm2-test.itheima.net/api/sys/user",
                      headers=get_headers_util(),
                      json=json_data)
        return resp
    #员工修改接口
    @classmethod
    def ihrm_emp_update(cls,emp_id,json_data):
        headers = get_headers_util()
        resp = requests.put(url=f"http://ihrm2-test.itheima.net/api/sys/user/{emp_id}",
                            headers=headers,
                            json=json_data)
        return resp